package com.raos.quartz.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * spring web 控制器 测试类
 *
 * @author raos
 * @email 991207823@qq.com
 * @date 2021/10/01 20:22
 */
@Controller
public class MyController {

    // 用来处理前台的login请求
    @RequestMapping("login")
    @ResponseBody
    private String login(@RequestParam(value = "username", required = false) String username,
                         @RequestParam(value = "password", required = false) String password) {
        System.out.println();
        System.out.println("接收请求获得参数username=" + username + ", password=" + password);
        System.out.println();
        return "Hello " + username + ",Your password is " + password;
    }

}
